package com.yan.controller;


import com.yan.pojo.User;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.PostConstruct;


@RestController
public class controller {

    @GetMapping("/hello")
    public String hello(){
        return "hello word";
    }


    @PostMapping("/user")
    public User user(){
        return new User();
    }

    @ApiOperation("hello 方法")//方法/文档 注释
    @PostMapping("/hello2")
    public String hello2(@ApiParam("用户名") String name){
        return "hello word2"+name;
    }

}
